package com.example.gym_manage_system.tools;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.Properties;

/**
 * @author qzy
 * @description 描述
 * @create 2023-12-06 15:33
 */
public class GetProps {

    private static final Properties props = new Properties();
    public static Properties init() {
        String filePath = "E:\\学习\\南宁师范大学\\Java程序设计课程\\项目\\gym_manage_system\\src\\main\\java\\com\\example\\gym_manage_system\\common\\config.properties";
        try {
            FileInputStream fileInputStream = new FileInputStream(filePath);
            InputStreamReader reader = new InputStreamReader(fileInputStream, StandardCharsets.UTF_8);
            props.load(reader);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return props;
    }
}
